<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ScreenCoder - UI转代码智能工具</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .feature-icon {
            font-size: 2.5rem;
            color: #6e8efb;
            margin-bottom: 1rem;
        }
        .dropdown:hover .dropdown-menu {
            display: block;
        }
        .mermaid {
            background: white;
            padding: 2rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Navigation -->
    <nav class="bg-white shadow-md sticky top-0 z-50">
        <div class="container mx-auto px-6 py-3">
            <div class="flex justify-between items-center">
                <div class="flex items-center space-x-4">
                    <i class="fas fa-code text-2xl text-indigo-600"></i>
                    <span class="text-xl font-bold text-gray-800">ScreenCoder</span>
                </div>
                <div class="hidden md:flex items-center space-x-8">
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition">功能特色</a>
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition">使用场景</a>
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition">优势对比</a>
                    <a href="#" class="text-gray-700 hover:text-indigo-600 transition">上手指南</a>
                    <a href="https://github.com/leigest519/ScreenCoder" target="_blank" class="bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition flex items-center">
                        <i class="fab fa-github mr-2"></i> GitHub
                    </a>
                </div>
                <div class="md:hidden">
                    <button class="text-gray-700 focus:outline-none">
                        <i class="fas fa-bars text-2xl"></i>
                    </button>
                </div>
            </div>
        </div>
    </nav>

    <!-- Hero Section -->
    <section class="hero text-white py-20">
        <div class="container mx-auto px-6 flex flex-col md:flex-row items-center">
            <div class="md:w-1/2 mb-10 md:mb-0">
                <h1 class="text-4xl md:text-5xl font-bold mb-4">将UI设计转化为完美代码</h1>
                <p class="text-xl mb-8 opacity-90">ScreenCoder 是一个开源工具，通过AI智能将UI截图或设计草图转化为结构清晰、可编辑的HTML和CSS代码，显著提升开发效率。</p>
                <div class="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4">
                    <a href="https://github.com/leigest519/ScreenCoder" target="_blank" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-gray-100 transition flex items-center justify-center">
                        <i class="fab fa-github mr-2"></i> 查看GitHub
                    </a>
                    <a href="#quick-start" class="bg-indigo-800 text-white px-6 py-3 rounded-lg font-medium hover:bg-indigo-900 transition flex items-center justify-center">
                        <i class="fas fa-rocket mr-2"></i> 快速开始
                    </a>
                </div>
            </div>
            <div class="md:w-1/2">
                <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1755406083865-462c79f6-bf90-4e95-a434-1294219a22b0.png" alt="ScreenCoder示例" class="rounded-lg shadow-2xl border-4 border-white">
            </div>
        </div>
    </section>

    <!-- Problem Section -->
    <section class="py-16 bg-white">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">它能解决什么问题</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-gray-50 p-6 rounded-lg shadow-md">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-clock"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">耗时的手工编码</h3>
                    <p class="text-gray-600">前端开发中，将设计稿转化为代码往往是一个耗时且容易出错的过程。开发者需要手动分析复杂的UI布局，确保像素级别的精确对齐。</p>
                </div>
                <div class="bg-gray-50 p-6 rounded-lg shadow-md">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-code"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">设计与开发鸿沟</h3>
                    <p class="text-gray-600">设计师通常缺乏编码技能，难以直接将视觉创意转化为功能性代码。这导致设计与实现之间存在巨大鸿沟。</p>
                </div>
                <div class="bg-gray-50 p-6 rounded-lg shadow-md">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-sync-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">迭代效率低下</h3>
                    <p class="text-gray-600">手动编码容易导致重复劳动，尤其是在快速迭代或处理复杂布局时，效率低下且容易出现视觉偏差。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Features Section -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">核心功能概述</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">ScreenCoder通过智能技术将UI截图转化为可用的前端代码，以下是其主要功能点</p>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>
            <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-8">
                <div class="card bg-white p-6 rounded-lg shadow-md transition duration-300">
                    <div class="feature-icon">
                        <i class="fas fa-search"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">UI元素检测</h3>
                    <p class="text-gray-600">通过视觉语言模型（VLM）识别截图中的按钮、文本框、图片等UI组件，并对其进行语义标注，确保准确捕获设计意图。</p>
                </div>
                <div class="card bg-white p-6 rounded-lg shadow-md transition duration-300">
                    <div class="feature-icon">
                        <i class="fas fa-project-diagram"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">层次化布局规划</h3>
                    <p class="text-gray-600">基于前端工程知识，生成层次化的布局树，自动规划组件的排列和间距，确保代码结构符合网页开发规范。</p>
                </div>
                <div class="card bg-white p-6 rounded-lg shadow-md transition duration-300">
                    <div class="feature-icon">
                        <i class="fas fa-code"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">自适应代码生成</h3>
                    <p class="text-gray-600">将检测到的组件和布局转化为干净的HTML/CSS代码，支持用户自定义修改，生成的代码易于编辑和优化。</p>
                </div>
                <div class="card bg-white p-6 rounded-lg shadow-md transition duration-300">
                    <div class="feature-icon">
                        <i class="fas fa-image"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">图像替换支持</h3>
                    <p class="text-gray-600">自动将截图中的图像元素裁剪并嵌入最终代码，替换占位符，确保视觉效果与原设计一致。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Workflow Diagram -->
    <section class="py-16 bg-white">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">工作原理</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>
            <div class="mermaid">
                graph TD
                    A[UI截图/设计草图] --> B[视觉理解模块]
                    B --> C[UI元素检测]
                    C --> D[语义标注]
                    D --> E[布局规划模块]
                    E --> F[生成层次化布局树]
                    F --> G[代码生成模块]
                    G --> H[HTML/CSS代码输出]
            </div>
        </div>
    </section>

    <!-- Use Cases -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">使用场景</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">ScreenCoder在多种实际场景中都能显著提升工作效率</p>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white p-6 rounded-lg shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4">
                            <i class="fas fa-lightbulb text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold">快速原型开发</h3>
                    </div>
                    <p class="text-gray-600">产品经理或设计师完成UI设计后，开发者可使用ScreenCoder将截图快速转化为HTML/CSS代码，用于构建交互式原型。例如，一个电商网站的首页设计稿可以迅速生成基本页面框架，供团队讨论和迭代。</p>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4">
                            <i class="fas fa-users text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold">设计到开发的协作</h3>
                    </div>
                    <p class="text-gray-600">在跨团队协作中，设计师无需编写代码，只需提供截图，ScreenCoder即可生成可用的前端代码，开发者再进行细节调整。这在快速开发小型项目或MVP（最小可行产品）时尤为有效。</p>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4">
                            <i class="fas fa-layer-group text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold">复杂布局复现</h3>
                    </div>
                    <p class="text-gray-600">对于包含多层次导航栏、侧边栏或动态组件的复杂UI，ScreenCoder能准确解析布局并生成结构化代码。例如，一个仪表盘界面的截图可以被分解为模块化的代码块，减少开发者手动布局的时间。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Advantages -->
    <section class="py-16 bg-white">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">优势与特色</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">与其他UI到代码工具相比，ScreenCoder具有独特优势</p>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>
            <div class="grid md:grid-cols-2 gap-12">
                <div>
                    <div class="mb-8">
                        <div class="flex items-start mb-4">
                            <div class="bg-indigo-100 p-2 rounded-md mr-4">
                                <i class="fas fa-puzzle-piece text-indigo-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-semibold mb-2">模块化架构</h3>
                                <p class="text-gray-600">通过将任务分解为视觉理解、布局规划和代码生成三个阶段，ScreenCoder比端到端黑盒模型更具可解释性和鲁棒性，能更精确地处理复杂UI布局。</p>
                            </div>
                        </div>
                    </div>
                    <div class="mb-8">
                        <div class="flex items-start mb-4">
                            <div class="bg-indigo-100 p-2 rounded-md mr-4">
                                <i class="fas fa-brain text-indigo-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-semibold mb-2">支持多种模型</h3>
                                <p class="text-gray-600">支持多种生成模型（如Doubao、Qwen、GPT、Gemini），用户可根据需求选择合适的模型，灵活性高。</p>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="mb-8">
                        <div class="flex items-start mb-4">
                            <div class="bg-indigo-100 p-2 rounded-md mr-4">
                                <i class="fas fa-database text-indigo-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-semibold mb-2">数据引擎功能</h3>
                                <p class="text-gray-600">ScreenCoder不仅生成代码，还能自动创建大规模图像-代码对，用于训练视觉语言模型，提升长期开发潜力。</p>
                            </div>
                        </div>
                    </div>
                    <div class="mb-8">
                        <div class="flex items-start mb-4">
                            <div class="bg-indigo-100 p-2 rounded-md mr-4">
                                <i class="fas fa-lock-open text-indigo-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-semibold mb-2">开源免费</h3>
                                <p class="text-gray-600">完全开源，代码透明，社区可自由贡献和优化，适合预算有限的团队或个人开发者。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Quick Start -->
    <section id="quick-start" class="py-16 bg-indigo-50">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">上手指南</h2>
                <p class="text-gray-700 max-w-2xl mx-auto">快速上手ScreenCoder的详细步骤，适合初学者</p>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>
            <div class="bg-white rounded-lg shadow-lg overflow-hidden max-w-4xl mx-auto">
                <div class="p-6 border-b">
                    <div class="flex items-center">
                        <div class="bg-indigo-100 text-indigo-600 p-2 rounded-full mr-4">
                            <i class="fas fa-terminal"></i>
                        </div>
                        <h3 class="text-xl font-semibold">安装与配置</h3>
                    </div>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h4 class="text-lg font-medium mb-3 text-indigo-600 flex items-center">
                            <span class="bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-2">1</span>
                            克隆仓库
                        </h4>
                        <div class="bg-gray-800 text-gray-100 p-4 rounded-lg overflow-x-auto">
                            <code class="text-sm">
                                git clone https://github.com/leigest519/ScreenCoder.git<br>
                                cd ScreenCoder
                            </code>
                        </div>
                    </div>
                    <div class="mb-8">
                        <h4 class="text-lg font-medium mb-3 text-indigo-600 flex items-center">
                            <span class="bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-2">2</span>
                            创建虚拟环境
                        </h4>
                        <div class="bg-gray-800 text-gray-100 p-4 rounded-lg overflow-x-auto">
                            <code class="text-sm">
                                python3 -m venv .venv<br>
                                source .venv/bin/activate  # Windows 用户使用：.venv\Scripts\activate
                            </code>
                        </div>
                    </div>
                    <div class="mb-8">
                        <h4 class="text-lg font-medium mb-3 text-indigo-600 flex items-center">
                            <span class="bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-2">3</span>
                            安装依赖
                        </h4>
                        <div class="bg-gray-800 text-gray-100 p-4 rounded-lg overflow-x-auto">
                            <code class="text-sm">pip install -r requirements.txt</code>
                        </div>
                    </div>
                    <div class="mb-8">
                        <h4 class="text-lg font-medium mb-3 text-indigo-600 flex items-center">
                            <span class="bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-2">4</span>
                            配置模型和API密钥
                        </h4>
                        <p class="text-gray-600 mb-3">
                            - 在 <code class="bg-gray-200 px-1 py-0.5 rounded">block_parsor.py</code> 和 <code class="bg-gray-200 px-1 py-0.5 rounded">html_generator.py</code> 中选择生成模型（如 Doubao、Qwen）<br>
                            - 在项目根目录创建对应模型的API密钥文件（如 <code class="bg-gray-200 px-1 py-0.5 rounded">doubao_api.txt</code>），并填入你的API密钥
                        </p>
                    </div>
                    <div class="mb-8">
                        <h4 class="text-lg font-medium mb-3 text-indigo-600 flex items-center">
                            <span class="bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-2">5</span>
                            运行工具
                        </h4>
                        <p class="text-gray-600 mb-3">将UI截图放入项目目录，运行以下命令生成HTML/CSS代码：</p>
                        <div class="bg-gray-800 text-gray-100 p-4 rounded-lg overflow-x-auto">
                            <code class="text-sm">python main.py</code>
                        </div>
                        <p class="text-gray-600 mt-3">该命令会依次执行组件检测、布局规划和代码生成，输出最终的HTML文件。</p>
                    </div>
                    <div>
                        <h4 class="text-lg font-medium mb-3 text-indigo-600 flex items-center">
                            <span class="bg-indigo-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-2">6</span>
                            检查和编辑输出
                        </h4>
                        <p class="text-gray-600">生成的HTML/CSS文件位于项目目录，开发者可直接打开进行调整或集成到现有项目中。</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>